package com.idefav;

import com.idefav.service.demo1Svc;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws InterruptedException {
        ApplicationContext context = new ClassPathXmlApplicationContext(
                new String[] {"spring/applicationContext-*.xml"});
        demo1Svc demo1Svc=(demo1Svc) context.getBean("demo1Svc");
        while (true){
            System.out.println(demo1Svc.getStr());
            Thread.sleep(1000);
        }

        // 按任意键退出
        //        System.out.println( "Hello World!" );
    }
}
